Devices and methods for fast charging using determined maximum charging current values

ABSTRACT

A fast charging method, apparatus, and device for a USB electronic device including obtaining, according to a preset charging current threshold, a corresponding charging data set of the electronic device under the present charging current threshold, determining, according to the charging data set, a maximum charging current value corresponding to the electronic device; setting the determined maximum charging current value as a charging current threshold of the electronic device, and controlling charging of the electronic device according to the charging current threshold.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a national stage of International Application No.PCT/CN2014/082339, filed on Jul. 16, 2014, which is hereby incorporatedby reference in its entirety.

TECHNICAL FIELD

Embodiments of the present disclosure relate to the communicationsfield, and in particular, to an electronic device fast charging method,apparatus, and device.

BACKGROUND

Currently, there are generally two manners for charging an electronicdevice: one manner is charging the electronic device by connecting theelectronic device to a dedicated charger (for example, a mobile phonecharger) of the electronic device; the other manner is charging theelectronic device by connecting the electronic device to a UniversalSerial Bus (USB) host device (for example, a personal computer (PC)) byusing a USB interface. Because host devices having a USB interface arewidely used, the charging manner of using a USB host device is widelyapplied because this charging manner is convenient.

In the prior art, when the electronic device is inserted into the USBhost device by using the USB interface, the electronic device determinesa USB supply current according to whether a communication handshake withthe USB host device is successful. If the communication handshake withthe USB host device fails, the USB charging current is limited below 100milliampere (mA). If the communication handshake with the USB hostdevice is successful, the USB charging current is limited below 500 mA.

However, because a charging current when charging is performed by usingthe USB interface is generally limited within 500 mA, a charging speedis relatively low. Especially, if the battery of an electronic device isdepleted or the battery is extremely low, charging by using the USBcannot support a user to perform a power-consuming operation such asmaking a call or playing a game. To simply improve a charging currentcauses a device to be restarted repeatedly due to an insufficientcharging voltage because the charging current becomes excessively high.In addition, the excessively high charging current further causes adevice board to heat. Continuous heat of the device board further causeslines on the board to expand with heat and be broken and damages theboard, and may even cause a fire safety accident. Therefore,implementing fast charging of an electronic device while ensuring thatthe device is safe is an urgent problem that needs to be resolved.

SUMMARY

In view of this, embodiments of the present disclosure provide anelectronic device fast charging method, apparatus, and device, so as toimplement safe and fast charging of an electronic device.

Accordingly, the following technical solutions are used in theembodiments of the present disclosure. According to a first aspect ofthe embodiments of the present disclosure, a fast charging method for anelectronic device is disclosed, where the electronic device has a USBinterface, and the method includes, when it is determined that theelectronic device has a successful communication handshake with a USBhost device by using the USB interface, obtaining, by means ofmeasurement according to a preset charging current threshold, acorresponding charging data set of the electronic device under thecharging current threshold, where the charging current thresholdincludes at least a first charging current threshold and a secondcharging current threshold, and the charging data set includes at leasta corresponding first charging voltage value and a corresponding firstcharging current value of the electronic device under the first chargingcurrent threshold, and a corresponding second charging voltage value anda corresponding second charging current value of the electronic deviceunder the second charging current threshold; determining, according tothe charging data set, a maximum charging current value corresponding tothe electronic device; and setting the determined maximum chargingcurrent value as a third charging current threshold of the electronicdevice, and controlling charging of the electronic device according tothe third charging current threshold.

In a first possible implementation manner of the first aspect, theobtaining, by means of measurement according to a preset chargingcurrent threshold, a corresponding charging data set of the electronicdevice under the charging current threshold includes setting a datacollection point in a power management integrated circuit of theelectronic device, and acquiring the corresponding charging data set ofthe electronic device under the charging current threshold from ananalog to digital converter of the power management integrated circuit.

With reference to the first possible implementation manner of the firstaspect, in a second possible implementation manner of the first aspect,the determining, according to the charging data set, a maximum chargingcurrent value corresponding to the electronic device includes obtaininga supply voltage value of the USB host device and an impedance value ofa USB connection cable by means of calculation according to the firstcharging voltage value, the first charging current value, the secondcharging voltage value, and the second charging current value; obtaininga charging current consumption rate coefficient by means of calculationaccording to the supply voltage value of the USB host device and theimpedance value of the USB connection cable that are obtained by meansof calculation, the first charging current threshold, and the secondcharging current threshold; and determining, according to the chargingcurrent consumption rate coefficient obtained by means of calculation, amaximum charging current value that corresponds to the electronic devicewhen a minimum working voltage of the electronic device is met.

In a third possible implementation manner of the first aspect, themethod further includes, when the determined maximum charging currentvalue is set as the third charging current threshold of the electronicdevice, switching the charging current threshold of the electronicdevice from the third charging current value to the first chargingcurrent threshold after charging of the electronic device is controlledaccording to the third charging current threshold for a first timevalue, and controlling charging of the electronic device according tothe first charging current threshold.

With reference to the third possible implementation manner of the firstaspect, in a fourth possible implementation manner of the first aspect,the method further includes, after charging of the electronic device iscontrolled according to the first charging current threshold for asecond time value, switching the charging current threshold of theelectronic device from the first charging current value to the thirdcharging current threshold, and controlling charging of the electronicdevice according to the third charging current threshold.

With reference to the third possible implementation manner of the firstaspect, in a fifth possible implementation manner of the first aspect,the switching the charging current threshold of the electronic devicefrom the third charging current value to the first charging currentthreshold after charging of the electronic device is controlledaccording to the third charging current threshold for a first timevalue, and controlling charging of the electronic device according tothe first charging current threshold includes detecting temperature dataof the electronic device; determining whether the temperature data isgreater than a first temperature threshold; and when it is determinedthat the temperature data is greater than the first temperaturethreshold, switching the charging current threshold of the electronicdevice from the third charging current value to the first chargingcurrent threshold, and controlling charging of the electronic deviceaccording to the first charging current threshold.

With reference to the third possible implementation manner of the firstaspect, in a sixth possible implementation manner of the first aspect,the switching the charging current threshold of the electronic devicefrom the third charging current value to the first charging currentthreshold after charging of the electronic device is controlledaccording to the third charging current threshold for a first timevalue, and controlling charging of the electronic device according tothe first charging current threshold includes determining whetherduration in which charging of the electronic device is controlledaccording to the third charging current threshold is greater than apreset first time threshold; and when it is determined that the durationin which charging of the electronic device is controlled according tothe third charging current threshold is greater than the preset firsttime threshold, switching the charging current threshold of theelectronic device from the third charging current value to the firstcharging current threshold, and controlling charging of the electronicdevice according to the first charging current threshold.

In a seventh possible implementation manner of the first aspect, thethird charging current threshold is greater than the first chargingcurrent threshold, and the first charging current threshold is greaterthan the second charging current threshold.

According to a second aspect of the embodiments of the presentdisclosure, a fast charging apparatus is disclosed, applied to anelectronic device, where the electronic device has a USB interface, andthe apparatus includes a measurement unit configured to, when it isdetermined that the electronic device has a successful communicationhandshake with a USB host device by using the USB interface, obtain, bymeans of measurement according to a preset charging current threshold, acorresponding charging data set of the electronic device under thecharging current threshold, where the charging current thresholdincludes at least a first charging current threshold and a secondcharging current threshold, and the charging data set includes at leasta corresponding first charging voltage value and a corresponding firstcharging current value of the electronic device under the first chargingcurrent threshold, and a corresponding second charging voltage value anda corresponding second charging current value of the electronic deviceunder the second charging current threshold; a charging current valuedetermining unit configured to determine, according to the charging dataset, a maximum charging current value corresponding to the electronicdevice; and a charging unit configured to set the determined maximumcharging current value as a third charging current threshold of theelectronic device, and control charging of the electronic deviceaccording to the third charging current threshold.

In a first possible implementation manner of the second aspect, themeasurement unit is specifically configured to set a data collectionpoint in a power management integrated circuit of the electronic device,and acquire the corresponding charging data set of the electronic deviceunder the charging current threshold from an analog to digital converterof the power management integrated circuit.

With reference to the first possible implementation manner of the secondaspect, in a second possible implementation manner of the second aspect,the charging current value determining unit includes a first calculationunit configured to obtain a supply voltage value of the USB host deviceand an impedance value of a USB connection cable by means of calculationaccording to the first charging voltage value, the first chargingcurrent value, the second charging voltage value, and the secondcharging current value that are obtained by means of measurement by themeasurement unit; a second calculation unit configured to obtain acharging current consumption rate coefficient by means of calculationaccording to the supply voltage value of the USB host device and theimpedance value of the USB connection cable that are obtained by thefirst calculation unit by means of calculation, the first chargingcurrent threshold, and the second charging current threshold; and athird calculation unit configured to determine, according to thecharging current consumption rate coefficient obtained by the secondcalculation unit by means of calculation, a maximum charging currentvalue that corresponds to the electronic device when a minimum workingvoltage of the electronic device is met.

In a third possible implementation manner of the second aspect, theapparatus further includes a first switch unit configured to when thedetermined maximum charging current value is set as the third chargingcurrent threshold of the electronic device, switch the charging currentthreshold of the electronic device from the third charging current valueto the first charging current threshold after charging of the electronicdevice is controlled according to the third charging current thresholdfor a first time value, and control charging of the electronic deviceaccording to the first charging current threshold; and a second switchunit configured to, after charging of the electronic device iscontrolled according to the first charging current threshold for asecond time value, switch the charging current threshold of theelectronic device from the first charging current value to the thirdcharging current threshold, and control charging of the electronicdevice according to the third charging current threshold.

With reference to the third possible implementation manner of the secondaspect, in a fourth possible implementation manner of the second aspect,the first switch unit includes a temperature detection unit configuredto detect temperature data of the electronic device; a first judgingunit configured to receive the temperature data detected by thetemperature detection unit and determine whether the temperature data isgreater than a first temperature threshold; and a first switch executionunit configured to receive a determining result of the first judgingunit and when the determining result shows that the temperature data isgreater than the first temperature threshold, switch the chargingcurrent threshold of the electronic device from the third chargingcurrent value to the first charging current threshold, and controlcharging of the electronic device according to the first chargingcurrent threshold; or the first switch unit includes a second judgingunit configured to determine whether duration in which charging of theelectronic device is controlled according to the third charging currentthreshold is greater than a preset first time threshold; and a secondswitch execution unit configured to receive a determining result of thesecond judging unit and when the determining result shows that theduration in which charging of the electronic device is controlledaccording to the third charging current threshold is greater than thepreset first time threshold, switch the charging current threshold ofthe electronic device from the third charging current value to the firstcharging current threshold, and control charging of the electronicdevice according to the first charging current threshold.

Technical effects of the foregoing technical solutions are analyzed asfollows. In the embodiments of the present disclosure, when it isdetermined that an electronic device has a successful communicationhandshake with a USB host device by using a USB interface, by presettinga first charging current threshold and a second charging currentthreshold for the electronic device, a first charging voltage value anda first charging current value of the electronic device under the firstcharging current threshold, and a second charging voltage value and asecond charging current value of the electronic device under the secondcharging current threshold are separately obtained by means ofmeasurement; a maximum charging current value corresponding to theelectronic device is determined according to charging data obtained bymeans of measurement; the determined maximum charging current value isset as a third charging current threshold of the electronic device; andcharging of the electronic device is controlled according to the thirdcharging current threshold. Because the maximum charging current valueobtained by means of measurement in the present disclosure is accurateand reliable, and is generally greater than 500 mA, while ensuring thatthe device is safe, a charging speed of the electronic device is greatlyimproved, the charging efficiency of the device is improved, and fastcharging of the device is implemented.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of an embodiment of a fast charging methodfor an electronic device according to the present disclosure;

FIG. 2 is a schematic diagram of another embodiment of a fast chargingmethod for an electronic device according to the present disclosure;

FIG. 3 is a schematic diagram of an equivalent circuit of a fastcharging method for an electronic device according to the presentdisclosure;

FIG. 4 is a schematic diagram of an embodiment of a fast chargingapparatus according to the present disclosure;

FIG. 5 is a schematic diagram of another embodiment of a fast chargingapparatus according to the present disclosure; and

FIG. 6 is a schematic diagram of an embodiment of an electronic deviceaccording to the present disclosure.

DESCRIPTION OF EMBODIMENTS

To resolve a technical problem in the prior art that a charging speed ofan electronic device is low, embodiments of the present disclosureprovide an electronic device fast charging method, apparatus, anddevice, so as to implement safe and fast charging of an electronicdevice.

To make a person skilled in the art understand the technical solutionsin the present disclosure better, the following clearly and completelydescribes the technical solutions in the embodiments of the presentdisclosure with reference to the accompanying drawings in theembodiments of the present disclosure. The described embodiments aremerely some but not all of the embodiments of the present disclosure.All other embodiments obtained by a person of ordinary skill in the artbased on the embodiments of the present disclosure without creativeefforts shall fall within the protection scope of the presentdisclosure.

The terms used in the embodiments of the present disclosure are merelyfor the purpose of illustrating specific embodiments, and are notintended to limit the present disclosure. The terms “a,” “said,” and“the” of singular forms used in the embodiments and the appended claimsof the present disclosure are also intended to include plural forms,unless otherwise specified in the context clearly. It should also beunderstood that, the term “and/or” used herein indicates and includesany or all possible combinations of one or more associated listed items.

It should be understood that, although in the embodiments of the presentdisclosure, terms such as “first,” “second,” and “third” may be used todescribe various charging current thresholds, charging data, chargingvoltage values, and charging current values, these charging currentthresholds, charging data, charging voltage values, and charging currentvalues are not limited to the terms. The terms are merely used todistinguish the charging current thresholds, the charging data, thecharging voltage values, and the charging current values. For example,without departing from the scope of the embodiments of the presentdisclosure, a first charging current threshold may also be referred toas a second charging current threshold. Similarly, the second chargingcurrent threshold may also be referred to as the first charging currentthreshold.

Depending on the context, for example, the word “if” used herein may beinterpreted as “while” or “when” or “in response to determining” or “inresponse to detection”. Similarly, depending on the context, the phrase“if determining” or “if detecting (a stated condition or event)” may beinterpreted as “when determining” or “in response to determining” or“when detecting (the stated condition or event)” or “in response todetecting (the stated condition or event)”.

First Embodiment

Refer to FIG. 1, which is a schematic diagram of an embodiment of a fastcharging method for an electronic device according to the presentdisclosure. The method shown in FIG. 1 is applied to an electronicdevice, and the electronic device has a USB interface and can implementa communication connection to a USB host device by using the USBinterface.

S101: When a fast charging apparatus determines that the electronicdevice has a successful communication handshake with a USB host deviceby using the USB interface, the fast charging apparatus obtains, bymeans of measurement according to a preset charging current threshold, acorresponding charging data set of the electronic device under thecharging current threshold. A first charging current threshold, a firstcharging current threshold, and first charging data.

In this embodiment of the present disclosure, the electronic device mayhave two charging modes: a fast charging mode and a normal chargingmode. When the electronic device is switched to the fast charging mode,the fast charging apparatus obtains, by means of measurement accordingto a preset charging current threshold, charging data of the electronicdevice under the charging current threshold; determines, according tothe charging data, a maximum charging current value corresponding to theelectronic device; sets the determined maximum charging current value asa third charging current threshold of the electronic device; andcontrols charging of the electronic device according to the thirdcharging current threshold. Because the third charging current thresholdis generally greater than a charging current threshold (500 mA) that isset in a USB communications protocol, fast charging of the electronicdevice can be implemented. When the electronic device is switched to thenormal charging mode, a method in the prior art may be used forcharging, that is, the charging current threshold of the electronicdevice is set to 500 mA regulated in the USB communications protocol,and charging of the electronic device is controlled according to thecharging current threshold. In this case, an actual charging current ofthe electronic device is generally less than 500 mA. Certainly, a personskilled in the art may understand that the electronic device may haveonly one charging mode, that is, the fast charging mode.

The electronic device may provide a graphical user interface, and a usersets the charging mode of the electronic device by using the graphicaluser interface. The electronic device receives a setting command of theuser, and the electronic device is switched from the normal chargingmode to the fast charging mode. Alternatively, the electronic device mayreceive a setting command of the user, and a default charging mode ofthe electronic device is set to the fast charging mode. Certainly, thecharging mode of the electronic device may be set by a system of theelectronic device, which is not limited herein.

When the electronic device is inserted into the USB host device by meansof the USB interface, the fast charging apparatus detects whether theelectronic device has a successful communication handshake with the USBhost device. In specific implementation, when the user inserts theelectronic device into the host device by using the USB interface, ifthe electronic device detects that a level of a data line of a port ofthe electronic device is pulled up, it is determined that the electronicdevice is inserted into the host device. In this case, the electronicdevice triggers interruption. An interruption service program instructsa USB drive to send, by using an end point, a USB enumeration command tothe USB host device. The USB host device sends a response to theelectronic device and determines, by exchanging a series of commands,whether USB communication can be established. If the USB communicationcan be established, it is considered that the electronic device has asuccessful communication handshake with the USB host device.

When it is determined that the electronic device has a successfulcommunication handshake with the USB host device by using the USBinterface, the fast charging apparatus obtains, by means of measurementaccording to the preset charging current threshold, the correspondingcharging data set of the electronic device under the charging currentthreshold. The charging current threshold includes at least a firstcharging current threshold and a second charging current threshold, andthe charging data set includes at least a corresponding first chargingvoltage value and a corresponding first charging current value of theelectronic device under the first charging current threshold, and acorresponding second charging voltage value and a corresponding secondcharging current value of the electronic device under the secondcharging current threshold. In specific implementation, the firstcharging current threshold is a preconfigured threshold and may be, forexample, the charging current threshold 500 mA that is regulated in theUSB Protocol. The first charging current threshold is a maximum chargingcurrent provided by the USB host device for the electronic device inthis case, that is, when the first charging current threshold of theelectronic device is set, a charging current provided by the USB hostdevice should not be greater than the first charging current threshold,for example, not greater than 500 mA. Correspondingly, the maximumcharging current value of the electronic device is not greater than thefirst charging current threshold. After the first charging currentthreshold is set successfully, first charging data of the electronicdevice under the first charging current threshold is collected. Thefirst charging data may include the first charging voltage value and thefirst charging current value. The first charging voltage value refers toa voltage value provided by the USB host device for the electronicdevice under the first charging current threshold, and the firstcharging current value refers to a current value provided by the USBhost device for the electronic device under the first charging currentthreshold. In specific implementation, the fast charging apparatus setsa register of a power management integrated circuit (PMIC) of theelectronic device, and stores, in the register, the charging currentthreshold that is set for the electronic device, for example, the firstcharging current threshold. After the PMIC detects that there is adevice coupled to a charging system, that is, after the PMIC determinesthat the electronic device is connected to the USB host device by usingthe USB interface, a charging current and a charging voltage of theelectronic device are adjusted according to the first charging currentthreshold stored in the register. Specifically, the PMIC includes apulse signal generator, a voltage regulator circuit, a pulse widthadjustment circuit, a voltage and current detection circuit, and afeedback circuit. The PMIC controls the intensity of the chargingcurrent by using the voltage and current detection circuit and thefeedback circuit, so that the charging current is not greater than thecharging current threshold set in the register.

The obtaining, by means of measurement according to a preset chargingcurrent threshold, a corresponding charging data set of the electronicdevice under the charging current threshold includes setting a datacollection point in a power management integrated circuit of theelectronic device, and acquiring, by the power management integratedcircuit, the corresponding charging data set of the electronic deviceunder the charging current threshold from an analog to digital converterof the power management integrated circuit. In specific implementation,the PMIC of the electronic device has a corresponding analog to digitalconverter (ADC) configured to monitor values such as the chargingcurrent and the charging voltage. Therefore, the first charging voltagevalue and the first charging current value can be obtained by readingcorresponding values in the ADC. The data collection point may be set onthe PMIC, corresponding to a power input point of the electronic device.In specific implementation, to obtain collected data that is moreaccurate, collection may be performed multiple times (for example, fivetimes), and an average value of collected data is used as finalmeasurement data to calculate the maximum charging current value.

After the first charging voltage value and the first charging currentvalue are obtained, according to the preset second charging currentthreshold, second measurement is performed on the charging data of theelectronic device, to collect the corresponding second charging voltagevalue and the corresponding second charging current value of theelectronic device under the second charging current threshold. Thesecond charging current threshold is a preconfigured threshold and maybe determined according to an empirical value. Generally, the secondcharging current threshold is less than the first charging currentthreshold. Theoretically, the maximum charging current value obtained bymeans of calculation is more accurate if the second charging currentthreshold is set to be far less than the first charging currentthreshold. However, if a value of the second charging current thresholdis set to be excessively small, there is a problem that errors inmeasuring charging voltage and charging current values are relativelylarge, causing a relatively large calculation error, and therefore themaximum charging current value obtained by means of calculation isinaccurate. Therefore, a proper second charging current threshold may bedetermined according to experience and a theory. In an embodiment of thepresent disclosure, the second charging current threshold may be set to450 mA and certainly, may be set to 400 mA or 350 mA, which is notlimited herein. The second charging current threshold is a maximumcharging current provided by the USB host device for the electronicdevice in this setting case, that is, when the second charging currentthreshold of the electronic device is set, a charging current providedby the USB host device should not be greater than the second chargingcurrent threshold, for example, not greater than 450 mA.Correspondingly, when the charging current threshold of the electronicdevice is set to the second charging current threshold, the maximumcharging current value of the electronic device is not greater than thesecond charging current threshold. After the second charging currentthreshold is set successfully, second charging data of the electronicdevice under the second charging current threshold is collected. Thesecond charging data may include the second charging voltage value andthe second charging current value. The second charging voltage valuerefers to a voltage provided by the USB host device for the electronicdevice under the second charging current threshold, and the secondcharging current value refers to a current provided by the USB hostdevice for the electronic device under the second charging currentthreshold. In specific implementation, the power management integratedcircuit of the electronic device has a corresponding ADC configured tomonitor values such as the charging current and the charging voltage.Therefore, the second charging voltage value and the second chargingcurrent value can be obtained by reading corresponding values in theADC. The data collection point may be set on the PMIC, corresponding tothe power input point of the electronic device. In specificimplementation, to obtain collected data that is more accurate,collection may be performed multiple times (for example, five times),and an average value of collected data is used as final measurement datato calculate the maximum charging current value.

S102: The fast charging apparatus determines, according to the chargingdata set, a maximum charging current value corresponding to theelectronic device.

In specific implementation, the fast charging apparatus obtains, bymeans of calculation according to the first charging voltage value, thefirst charging current value, the second charging voltage value, and thesecond charging current value, a maximum charging current valuecorresponding to the electronic device.

In specific implementation, step S102 may include the following substeps(not shown in FIG. 1).

S102A: The fast charging apparatus obtains a supply voltage value of theUSB host device and an impedance value of a USB connection cable bymeans of calculation according to the first charging voltage value, thefirst charging current value, the second charging voltage value, and thesecond charging current value.

S102B: The fast charging apparatus obtains a supply current consumptionrate coefficient by means of calculation according to the supply voltagevalue of the USB host device, the impedance value of the USB connectioncable, the first charging current threshold, and the second chargingcurrent threshold.

S102: The fast charging apparatus determines, according the supplycurrent consumption rate coefficient obtained by means of calculation, amaximum charging current value that corresponds to the electronic devicewhen a minimum working voltage of the electronic device is met.

S103: The fast charging apparatus sets the determined maximum chargingcurrent value as a third charging current threshold of the electronicdevice, and controls charging of the electronic device according to thethird charging current threshold.

In this case, the fast charging apparatus sets the determined maximumcharging current value as a third charging current threshold of theelectronic device, and controls charging of the electronic deviceaccording to the third charging current threshold. That is, the fastcharging apparatus controls the charging current of the electronicdevice within the third charging current threshold by means ofprocessing, that is, a maximum charging current of the electronic deviceis less than or equal to the third charging current threshold. In thisembodiment of the present disclosure, the third charging currentthreshold is greater than the first charging current threshold, and thefirst charging current threshold is greater than the second chargingcurrent threshold.

In specific implementation, the fast charging apparatus sets a registerof the power management integrated circuit PMIC of the electronicdevice, and stores, in the register, the charging current threshold thatis set for the electronic device, for example, the third chargingcurrent threshold. After the PMIC detects that there is a device coupledto a charging system, that is, after the PMIC determines that theelectronic device is connected to the USB host device by using the USBinterface, a charging current and a charging voltage of the electronicdevice are adjusted according to the third charging current thresholdstored in the register. Specifically, the PMIC includes a pulse signalgenerator, a voltage regulator circuit, a pulse width adjustmentcircuit, a voltage and current detection circuit, and a feedbackcircuit. The PMIC controls the intensity of the charging current byusing the voltage and current detection circuit and the feedbackcircuit, so that the charging current is not greater than the thirdcharging current threshold set in the register, thereby implementingcontrol over charging of the electronic device according to the thirdcharging current threshold. It should be noted that, the abovedescriptions are merely exemplary descriptions of this embodiment, andan order of steps is not limited in the present disclosure.

In this embodiment of the present disclosure, when it is determined thatan electronic device has a successful communication handshake with a USBhost device by using a USB interface, by presetting a first chargingcurrent threshold and a second charging current threshold for theelectronic device, a first charging voltage value and a first chargingcurrent value of the electronic device under the first charging currentthreshold, and a second charging voltage value and a second chargingcurrent value of the electronic device under the second charging currentthreshold are separately obtained by means of measurement; a maximumcharging current value corresponding to the electronic device isdetermined according to charging data obtained by means of measurement;the determined maximum charging current value is set as a third chargingcurrent threshold of the electronic device; and charging of theelectronic device is controlled according to the third charging currentthreshold. Because the maximum charging current value obtained by meansof measurement in the present disclosure is accurate and reliable, andis generally greater than 500 mA, while ensuring that the device issafe, a charging speed of the electronic device is greatly improved, thecharging efficiency of the device is improved, and fast charging of thedevice is implemented.

Second Embodiment

Refer to FIG. 2, which is a schematic diagram of another embodiment of afast charging method for an electronic device according to the presentdisclosure.

In this embodiment of the present disclosure, to ensure more sufficientheat dissipation of a USB power cable, after an electronic device ischarged for a period of time by using a determined maximum chargingcurrent value, a charging current of the electronic device may beswitched between the maximum charging current value and a first chargingcurrent threshold to charge the electronic device, to further ensurethat USB charging is fast, safe, and reliable. The following describes aspecific implementation method of the present disclosure by using anexample in which the electronic device is a mobile phone and a USB hostdevice is a PC. A person skilled in the art can understand that thefollowing method may be applied to another electronic device having aUSB interface. The USB host device is not limited to the PC either, andmay further be another device having a USB interface.

S201: A fast charging apparatus determines whether a mobile phoneenables a USB fast charging mode; and if yes, go to step S202; or ifnot, the procedure ends.

S202: The fast charging apparatus determines whether the mobile phone isinserted into a USB host device and has a successful communicationhandshake with the USB host device. If yes, go to step S203; if not,perform polling and wait until a data connection between a USB of themobile phone and a USB device of a PC is established successfully.

S203: After the data connection between the USB of the mobile phone andthe PC USB is established successfully, the fast charging apparatus setsthe mobile phone to be in a USB fast charging measurement mode. In thiscase, to more accurately obtain charging data about charging the mobilephone by using the USB, a central processing unit (CPU) clock speed andbacklight luminance may be fixed, and functions such as a data servicemay be disabled.

S204: The fast charging apparatus sets a USB charging current thresholdto a first charging current threshold A_value (500 mA) and collects afirst charging data set A of the mobile phone under this threshold.

In specific implementation, the first charging data set A may include aUSB first charging voltage V_(A), a first charging current I_(A), acurrent that is supplied from the USB and that is consumed by the mobilephone, a current for charging a battery, and the like.

S205: The fast charging apparatus sets the USB charging currentthreshold to a second charging current threshold B_value (450 mA) andcollects a charging data set B of the mobile phone under this threshold.

In specific implementation, the charging data set B may include a USBcharging voltage V_(B), a charging current I_(B), a current that issupplied from the USB and that is consumed by the mobile phone, acurrent for charging a battery, and the like.

S206: The fast charging apparatus performs analysis and obtains, bymeans of calculation according to the charging data set A and thecharging data set B that are obtained by means of measurement, a maximumsupply current value C_value that a current USB power supply device canprovide.

The following provides a detailed description. Refer to FIG. 3, which isa schematic diagram of an equivalent circuit of a fast charging methodfor an electronic device according to the present disclosure. In FIG. 3,R_device is equivalent to the electronic device (for example, a mobilephone) having a USB interface, and DC_PC_USB_Host is equivalent to a USBHost power supply of the USB host device (for example, a PC), and isequivalent to a power source. R_usb is equivalent to a USB connectioncable (USB Cable). A charging data collection point is set on a PMICinside the electronic device (for example, a mobile phone), that is, ona power input point of the electronic device.

It is assumed that when a first charging current threshold A_value isset to 500 mA, a first charging current and a first charging voltagecollected at the collection point are I_(A) and V_(A); and when a secondcharging current threshold B_value is set to 450 mA, a second chargingcurrent and a second charging voltage collected at the collection pointare I_(B) and V_(B).

A supply voltage value V_(ba) of the USB host device and an impedancevalue R_(usb) of the USB connection cable are first obtained by means ofcalculation according to the first charging voltage value V_(A), thefirst charging current value I_(A), the second charging voltage valueV_(B), and the second charging current value I_(B) that are obtained bymeans of measurement.

Therefore, the impedance value R_(usb) of the USB connection cable andthe supply voltage value V_(bat) of the USB host device can be obtainedby means of calculation according to formulas (1) and (2), which isspecifically as follows. When the first charging current thresholdA_value is set to 500 mA:V _(bat) =I _(A) *R _(usb) +V _(A)  (1)

When the second charging current threshold A_value is set to 450 mA:V _(bat)=I_(B) *R _(usb) +V _(B)  (2)

R_(usb) and V_(bat) can be obtained by means of calculation bysubstituting the collected I_(A) and V_(A) into (1) and substituting thecollected I_(B) and V_(B) into (2).

Therefore, the supply voltage value V_(bat) of the USB host device andthe impedance value R_(usb) of the USB connection cable can be obtain bymeans of calculation.

Then, a charging current consumption rate coefficient is obtained bymeans of calculation by using the supply voltage value of the USB hostdevice and the impedance value of the USB connection cable that areobtained by means of calculation, the first charging current threshold,and the second charging current threshold.

In specific implementation, charging current consumption ratecoefficients k and b can be obtained by means of calculation by usingformulas (4) and (5).500=k*I _(A) +b  (3)450=k*I _(B) +b  (4)

A slope k and an intercept b, that is, the charging current consumptionrate coefficients, can be obtained by means of calculation bysubstituting the collected first charging current value I_(A) and secondcharging current value I_(B) into formulas (4) and (5).

Finally, a maximum charging current value that corresponds to theelectronic device when a minimum working voltage of the electronicdevice is met is obtained according to the charging current consumptionrate coefficients obtained by means of calculation. When a lower limitrequired by a USB protocol is met, that is, when a minimum workingvoltage 4.75 V of the collection point is met, a current value of acollection current is I_(c). Therefore, the following equation applies.V _(bat) =I _(C) *R _(usb)+4.75V  (5)

The collection current I_(C) can be obtained by means of calculationaccording to formula (5).

Because there is a loss during transmission of the current, the maximumcharging current value C_value and I_(c) meet the following condition.C_value=k*I _(C) +b  (6)

Therefore, a value of the maximum charging current C_value can beobtained by substituting the obtained charging current consumption ratecoefficients k and b into formula (6).

S207: The fast charging apparatus sets a charging current threshold ofthe mobile phone to a maximum charging current value C_value and enablesthe mobile phone to exit the USB fast charging measurement mode, torestore previous parameters of the mobile phone such as a clock speedand backlight and resume functions such as a data service.

S208: The fast charging apparatus controls, by using the determinedmaximum charging current value C_value as a third charging currentthreshold, the electronic device to be charged for a time of a firsttime value D_time under the third charging current threshold.

S209: The fast charging apparatus switches the charging currentthreshold of the electronic device from the third charging currentthreshold to the first charging current threshold A_value, to charge theelectronic device.

In specific implementation, after the electronic device is charged forthe first time value by using the determined maximum charging currentvalue C_value as the third charging current threshold, the chargingcurrent threshold of the electronic device is switched from the thirdcharging current threshold C_value to the first charging currentthreshold A_value, to charge the electronic device.

In specific implementation, there may be different implementationmanners according to different triggering timing. In one possibleimplementation manner, a corresponding adjustment may be made accordingto temperature data detected by a temperature detection module of theelectronic device. Specifically, temperature data of the electronicdevice is detected; it is determined whether the temperature data meetsa first preset condition; and when it is determined that the temperaturedata meets the first preset condition, a supply current of theelectronic device is switched from the maximum charging current value tothe first charging current threshold, to charge the electronic device.The first preset condition may be that the temperature data is greaterthan a first preset temperature threshold, or may be that thetemperature data is within a preset temperature interval. In this case,if the electronic device gets hot, it is considered that the chargingcurrent threshold of the electronic device needs to be adjusted. Inspecific implementation, a dynamic adjustment may be made according totemperature changes. Specifically, a parameter such as a clock speed isproperly adjusted according to a current clock speed used by the mobilephone or the like, and the USB charging current threshold is set to thefirst charging current threshold A_value.

In another possible implementation manner, when it is determined thatcharging duration of the device is greater than or equal to apredetermined time threshold, switching is performed, which, forexample, may include determining whether duration in which charging ofthe electronic device is controlled according to the third chargingcurrent threshold is greater than a preset first time threshold; andwhen it is determined that the duration in which charging of theelectronic device is controlled according to the third charging currentthreshold is greater than the preset first time threshold, switching thecharging current threshold of the electronic device from the thirdcharging current value to the first charging current threshold, andcontrolling charging of the electronic device according to the firstcharging current threshold.

S210: The fast charging apparatus controls the electronic device to becharged for a time of a second time value E_time according to the firstcharging current threshold.

Determining of the time of the second time value E_time may be adjustedaccording to a temperature detected by a temperature detection module,or adjustment and switching may be performed according to whethercharging duration of the device is greater than a preset threshold.

Similarly, in one possible implementation manner, the temperature dataof the electronic device is detected; it is determined whether thetemperature data meets a second preset condition; and when it isdetermined that the temperature data meets the second preset condition,the charging current threshold of the electronic device is switched fromthe first charging current threshold to the maximum charging currentvalue (the third charging current threshold), to charge the electronicdevice. The second preset condition may be that the temperature data isless than a second preset temperature threshold, or may be that thetemperature data is within a preset temperature interval. In this case,the electronic device does not get hot or heat dissipation of theelectronic device is relatively sufficient, and it is considered thatthe charging current threshold of the electronic device may be adjusted.In specific implementation, a dynamic adjustment may be made accordingto temperature changes. Specifically, parameters such as a clock speedare properly adjusted according to a current clock speed used by themobile phone or the like, and a USB supply current is set to C_value.

In another possible implementation manner, when it is determined thatcharging duration of the device is greater than or equal to apredetermined time threshold, switching is performed, which, forexample, may include determining whether duration in which charging ofthe electronic device is controlled according to the first chargingcurrent threshold is greater than a preset second time threshold; andwhen it is determined that the duration in which charging of theelectronic device is controlled according to the first charging currentthreshold is greater than the preset second time threshold, switchingthe charging current threshold of the electronic device from the firstcharging current value to the third charging current threshold, andcontrolling charging of the electronic device according to the thirdcharging current threshold.

S211: The fast charging apparatus determines whether to continuecharging; and if yes, go to step S207 to repeat the foregoing steps incyclic manner until USB charging is finished or the USB is pulled out.

After charging by using the first charging current threshold lasts asecond time, it is determined whether to continue charging; and if yes,go to step S207, to switch the charging current threshold of theelectronic device from the first charging current threshold to themaximum charging current value (that is, the third charging currentthreshold), to charge the electronic device; or if it is determined thatcharging is already completed, the procedure ends.

It should be noted that, when a charging data set is obtained by meansof measurement according to a preconfigured charging current threshold,detection may be performed multiple times, for example, detection isperformed three times, which may be respectively detecting a firstcharging current value of an electronic device under a first chargingcurrent threshold, detecting a second charging current value of anelectronic device under a second charging current threshold, anddetecting a fourth charging current value of an electronic device undera fourth charging current threshold. A maximum charging current value isthen determined according to charging data obtained by means of threetimes of detection. The case of performing detection multiple times maybe implemented with reference to the methods shown in FIG. 1 to FIG. 3,and details are not described herein again. In this embodiment of thepresent disclosure, to implement fast charging of an electronic device,when it is determined that the electronic device is in a fast chargingmode and has a successful communication handshake with a USB host deviceby using the USB interface, the electronic device is switched to a USBfast charging measurement mode. In this mode, by detecting multiplegroups of USB safe charging currents, a maximum USB safe chargingcurrent that the USB host device (that is, a PC) can provide is obtainedby means of analysis and calculation. In addition, a charging currentthreshold of the electronic device is switched between the maximum safecharging current C_value and a preset threshold A_value, so that heatdissipation of a USB power cable can be more sufficient, which improvessafety of charging.

It should be noted that, the fast charging method in the presentdisclosure is described above by using an example in which the fastcharging apparatus is an independent device. A person skilled in the artcan understand that, the methods shown in FIG. 1 to FIG. 3 may beapplied to an electronic device having a USB interface, that is, themethods may be performed by an electronic device having a USB interface.

Third Embodiment

Refer to FIG. 4, which is a schematic diagram of an embodiment of a fastcharging apparatus according to the present disclosure. The fastcharging apparatus shown in FIG. 4 is to implement the methods in theforegoing embodiments shown in FIG. 1 to FIG. 3.

A fast charging apparatus is applied to an electronic device, where theelectronic device has a USB interface, and the apparatus includes ameasurement unit 401 configured to when it is determined that theelectronic device has a successful communication handshake with a USBhost device by using the USB interface, obtain, by means of measurementaccording to a preset charging current threshold, a correspondingcharging data set of the electronic device under the charging currentthreshold, where the charging current threshold includes at least afirst charging current threshold and a second charging currentthreshold, and the charging data set includes at least a correspondingfirst charging voltage value and a corresponding first charging currentvalue of the electronic device under the first charging currentthreshold, and a corresponding second charging voltage value and acorresponding second charging current value of the electronic deviceunder the second charging current threshold; a charging current valuedetermining unit 402 configured to determine, according to the chargingdata set, a maximum charging current value corresponding to theelectronic device; and a charging unit 403 configured to set thedetermined maximum charging current value as a third charging currentthreshold of the electronic device, and control charging of theelectronic device according to the third charging current threshold.

Further, the measurement unit is specifically configured to set a datacollection point in a power management integrated circuit of theelectronic device, and acquire the corresponding charging data set ofthe electronic device under the charging current threshold from ananalog to digital converter of the power management integrated circuit.

Further, the charging current value determining unit includes a firstcalculation unit (not shown) configured to obtain a supply voltage valueof the USB host device and an impedance value of a USB connection cableby means of calculation according to the first charging voltage value,the first charging current value, the second charging voltage value, andthe second charging current value that are obtained by the measurementunit by means of measurement; a second calculation unit configured toobtain a charging current consumption rate coefficient by means ofcalculation according to the supply voltage value of the USB host deviceand the impedance value of the USB connection cable that are obtained bythe first calculation unit by means of calculation, the first chargingcurrent threshold, and the second charging current threshold; and athird calculation unit (not shown) configured to determine, according tothe charging current consumption rate coefficient obtained by the secondcalculation unit by means of calculation, a maximum charging currentvalue that corresponds to the electronic device when a minimum workingvoltage of the electronic device is met.

Further, the apparatus further includes a first switch unit (not shown)configured to, when the determined maximum charging current value is setas the third charging current threshold of the electronic device, switchthe charging current threshold of the electronic device from the thirdcharging current value to the first charging current threshold aftercharging of the electronic device is controlled according to the thirdcharging current threshold for a first time value, and control chargingof the electronic device according to the first charging currentthreshold; and a second switch unit (not shown) configured to, aftercharging of the electronic device is controlled according to the firstcharging current threshold for a second time value, switch the chargingcurrent threshold of the electronic device from the first chargingcurrent value to the third charging current threshold, and controlcharging of the electronic device according to the third chargingcurrent threshold.

Further, the first switch unit includes a temperature detection unit(not shown) configured to detect temperature data of the electronicdevice; a first judging unit (not shown) configured to receive thetemperature data detected by the temperature detection unit anddetermine whether the temperature data is greater than a firsttemperature threshold; and a first switch execution unit (not shown)configured to receive a determining result of the first judging unit andwhen the determining result shows that the temperature data is greaterthan the first temperature threshold, switch the charging currentthreshold of the electronic device from the third charging current valueto the first charging current threshold, and control charging of theelectronic device according to the first charging current threshold; orthe first switch unit includes a second judging unit (not shown)configured to determine whether duration in which charging of theelectronic device is controlled according to the third charging currentthreshold is greater than a preset first time threshold; and a secondswitch execution unit (not shown) configured to receive a determiningresult of the second judging unit and when the determining result showsthat the duration in which charging of the electronic device iscontrolled according to the third charging current threshold is greaterthan the preset first time threshold, switch the charging currentthreshold of the electronic device from the third charging current valueto the first charging current threshold, and control charging of theelectronic device according to the first charging current threshold.

Fourth Embodiment

Refer to FIG. 5, which is a schematic diagram of still anotherembodiment of a fast charging apparatus according to the presentdisclosure. The fast charging apparatus shown in FIG. 5 is to implementthe methods in the foregoing embodiment shown in FIG. 1 to FIG. 3.

FIG. 5 shows a structure of a fast charging apparatus according toanother embodiment of the present disclosure, which includes at least amemory 501, a processor 502 (for example, a CPU), and at least onecommunications bus 503, to implement connections and communicationbetween these apparatuses. The processor 502 is configured to execute anexecutable module stored in the memory 501, for example, a computerprogram. The memory 501 may include a high-speed random access memory(RAM), and may further include a non-volatile memory, such as at leastone magnetic disk memory.

In some implementation manners, the processor 502 is configured to, whenit is determined that the electronic device has a successfulcommunication handshake with a USB host device by using the USBinterface, obtain, by means of measurement according to a presetcharging current threshold, a corresponding charging data set of theelectronic device under the charging current threshold, where thecharging current threshold includes at least a first charging currentthreshold and a second charging current threshold, and the charging dataset includes at least a corresponding first charging voltage value and acorresponding first charging current value of the electronic deviceunder the first charging current threshold, and a corresponding secondcharging voltage value and a corresponding second charging current valueof the electronic device under the second charging current threshold;determine, according to the charging data set, a maximum chargingcurrent value corresponding to the electronic device; and set thedetermined maximum charging current value as a third charging currentthreshold of the electronic device, and control charging of theelectronic device according to the third charging current threshold.

In some implementation manners, the processor 502 is further configuredto set a data collection point in a power management integrated circuitof the electronic device, and acquire the corresponding charging dataset of the electronic device under the charging current threshold froman analog to digital converter of the power management integratedcircuit.

In some implementation manners, the processor 502 is further configuredto obtain a supply voltage value of the USB host device and an impedancevalue of a USB connection cable by means of calculation according to thefirst charging voltage value, the first charging current value, thesecond charging voltage value, and the second charging current value;obtain a charging current consumption rate coefficient by means ofcalculation according to the supply voltage value of the USB host deviceand the impedance value of the USB connection cable that are obtained bymeans of calculation, the first charging current threshold, and thesecond charging current threshold; and determine, according to thecharging current consumption rate coefficient obtained by means ofcalculation, a maximum charging current value that corresponds to theelectronic device when a minimum working voltage of the electronicdevice is met.

In some implementation manners, the processor 502 is further configuredto, when the determined maximum charging current value is set as thethird charging current threshold of the electronic device, switch thecharging current threshold of the electronic device from the thirdcharging current value to the first charging current threshold aftercharging of the electronic device is controlled according to the thirdcharging current threshold for a first time value, and control chargingof the electronic device according to the first charging currentthreshold.

In some implementation manners, the processor 502 is further configuredto after charging of the electronic device is controlled according tothe first charging current threshold for a second time value, switch thecharging current threshold of the electronic device from the firstcharging current value to the third charging current threshold, andcontrol charging of the electronic device according to the thirdcharging current threshold.

In some implementation manners, the processor 502 is further configuredto detect temperature data of the electronic device; determine whetherthe temperature data is greater than a first temperature threshold; andwhen it is determined that the temperature data is greater than thefirst temperature threshold, switch the charging current threshold ofthe electronic device from the third charging current value to the firstcharging current threshold, and control charging of the electronicdevice according to the first charging current threshold.

In some implementation manners, the processor 502 is further configuredto determine whether duration in which charging of the electronic deviceis controlled according to the third charging current threshold isgreater than a preset first time threshold; and when it is determinedthat the duration in which charging of the electronic device iscontrolled according to the third charging current threshold is greaterthan the preset first time threshold, switch the charging currentthreshold of the electronic device from the third charging current valueto the first charging current threshold, and control charging of theelectronic device according to the first charging current threshold.

In some implementation manners, the third charging current threshold isgreater than the first charging current threshold, and the firstcharging current threshold is greater than the second charging currentthreshold.

Fifth Embodiment

Refer to FIG. 6, which is a schematic diagram of an embodiment of anelectronic device according to the present disclosure. The fast chargingapparatus shown in FIG. 6 is to implement the methods in the foregoingembodiments shown in FIG. 1 to FIG. 3.

An electronic device is provided, where the electronic device has a USBinterface, and the device includes a measurement module 601 configuredto, when it is determined that the electronic device has a successfulcommunication handshake with a USB host device by using the USBinterface, obtain, by means of measurement according to a presetcharging current threshold, a corresponding charging data set of theelectronic device under the charging current threshold, where thecharging current threshold includes at least a first charging currentthreshold and a second charging current threshold, and the charging dataset includes at least a corresponding first charging voltage value and acorresponding first charging current value of the electronic deviceunder the first charging current threshold, and a corresponding secondcharging voltage value and a corresponding second charging current valueof the electronic device under the second charging current threshold; acharging current value determining module 602 configured to determine,according to the charging data set, a maximum charging current valuecorresponding to the electronic device; and a charging module 603configured to set the determined maximum charging current value as athird charging current threshold of the electronic device, and controlcharging of the electronic device according to the third chargingcurrent threshold.

In some implementation manners, the measurement module is specificallyconfigured to set a data collection point in a power managementintegrated circuit of the electronic device, and acquire thecorresponding charging data set of the electronic device under thecharging current threshold from an analog to digital converter of thepower management integrated circuit.

In some implementation manners, the charging current value determiningmodule includes a first calculation module configured to obtain a supplyvoltage value of the USB host device and an impedance value of a USBconnection cable by means of calculation according to the first chargingvoltage value, the first charging current value, the second chargingvoltage value, and the second charging current value that are obtainedby the measurement module by means of measurement; a second calculationmodule configured to obtain a charging current consumption ratecoefficient by means of calculation according to the supply voltagevalue of the USB host device and the impedance value of the USBconnection cable that are obtained by the first calculation module bymeans of calculation, the first charging current threshold, and thesecond charging current threshold; and a third calculation moduleconfigured to determine, according to the charging current consumptionrate coefficient obtained by the second calculation module by means ofcalculation, a maximum charging current value that corresponds to theelectronic device when a minimum working voltage of the electronicdevice is met.

In some implementation manners, the apparatus further includes a firstswitch module (not shown) configured to, when the determined maximumcharging current value is set as the third charging current threshold ofthe electronic device, switch the charging current threshold of theelectronic device from the third charging current value to the firstcharging current threshold after charging of the electronic device iscontrolled according to the third charging current threshold for a firsttime value, and control charging of the electronic device according tothe first charging current threshold; and a second switch module (notshown) configured to, after charging of the electronic device iscontrolled according to the first charging current threshold for asecond time value, switch the charging current threshold of theelectronic device from the first charging current value to the thirdcharging current threshold, and control charging of the electronicdevice according to the third charging current threshold.

With reference to the third possible implementation manner of the secondaspect, in a fourth possible implementation manner of the second aspect,the first switch module includes a temperature detection module (notshown) configured to detect temperature data of the electronic device; afirst judging module (not shown) configured to receive the temperaturedata detected by the temperature detection module and determine whetherthe temperature data is greater than a first temperature threshold; anda first switch execution module (not shown) configured to receive adetermining result of the first judging module and when the determiningresult shows that the temperature data is greater than the firsttemperature threshold, switch the charging current threshold of theelectronic device from the third charging current value to the firstcharging current threshold, and control charging of the electronicdevice according to the first charging current threshold; or the firstswitch module includes a second judging module (not shown) configured todetermine whether duration in which charging of the electronic device iscontrolled according to the third charging current threshold is greaterthan a preset first time threshold; and a second switch execution module(not shown) configured to receive a determining result of the secondjudging module and when the determining result shows that the durationin which charging of the electronic device is controlled according tothe third charging current threshold is greater than the preset firsttime threshold, switch the charging current threshold of the electronicdevice from the third charging current value to the first chargingcurrent threshold, and control charging of the electronic deviceaccording to the first charging current threshold.

It should be noted that, steps of the foregoing embodiments of thepresent disclosure are not mandatory and are merely exemplary fordescription. Other embodiments may be obtained from the foregoingembodiments by means of modification, transformation, or combination andall fall within the protection scope of the present disclosure.

Those of ordinary skill in the art should understand that the procedureof the method according to the embodiments may be implemented by aprogram instructing relevant hardware. The program may be stored in areadable storage medium. When the program is run, the correspondingsteps of the method according to the embodiments of the presentdisclosure are performed. The storage medium may be a ROM/RAM, amagnetic disk, an optical disc, and the like.

The foregoing descriptions are merely exemplary implementation mannersof the present disclosure. It should be noted that a person of ordinaryskill in the art may make several improvements or polishing withoutdeparting from the principle of the present disclosure and theimprovements or polishing shall fall within the protection scope of thepresent disclosure.

What is claimed is:
 1. A fast charging method for an electronic device,the method comprising: performing a successful communication handshakewith a Universal Serial Bus (USB) host device using a USB interface ofthe electronic device; measuring, for a plurality of preset chargingcurrent thresholds, a charging data set of the electronic device underthe plurality of preset charging current thresholds, the plurality ofpreset charging current thresholds comprising a first charging currentthreshold and a second charging current threshold, and the charging dataset comprising: a corresponding first charging voltage value and acorresponding first charging current value of the electronic deviceunder the first charging current threshold; and a corresponding secondcharging voltage value and a corresponding second charging current valueof the electronic device under the second charging current threshold;calculating a maximum charging current value corresponding to theelectronic device according to the corresponding first charging voltagevalue, the corresponding first charging current value, the correspondingsecond charging voltage value, and the corresponding second chargingcurrent value, the maximum charging current value being different thanthe first charging current threshold and the second charging currentthreshold; setting the maximum charging current value as a thirdcharging current threshold of the electronic device; and controllingcharging of the electronic device according to the third chargingcurrent threshold.
 2. The method according to claim 1, wherein measuringthe charging data set comprises, for each preset charging currentthreshold of the plurality of preset charging current thresholds:setting a data collection point in a power management integrated circuitof the electronic device; and acquiring a corresponding charging dataset of the electronic device under the preset charging current thresholdfrom an analog to digital converter of the power management integratedcircuit.
 3. The method according to claim 1, wherein calculating themaximum charging current value comprises: calculating a supply voltagevalue of the USB host device and an impedance value of a USB connectioncable according to the corresponding first charging voltage value, thecorresponding first charging current value, the corresponding secondcharging voltage value, and the corresponding second charging currentvalue; calculating a charging current consumption rate coefficientaccording to the supply voltage value of the USB host device, theimpedance value of the USB connection cable, the first charging currentthreshold, and the second charging current threshold; and calculatingthe maximum charging current value according to the charging currentconsumption rate, the maximum charging current value corresponding tothe electronic device when a minimum working voltage of the electronicdevice is met.
 4. The method according to claim 1, wherein after themaximum charging current value is set to the third charging currentthreshold, the method further comprises: switching a charging currentthreshold of the electronic device from third charging current thresholdto the first charging current threshold after charging of the electronicdevice is controlled according to the third charging current thresholdfor a first time value; and controlling charging of the electronicdevice according to the first charging current threshold.
 5. The methodaccording to claim 4, further comprising: controlling charging of theelectronic device according to the first charging current threshold fora second time value; switching the charging current threshold of theelectronic device from the first charging current threshold to the thirdcharging current threshold; and controlling charging of the electronicdevice according to the third charging current threshold.
 6. The methodaccording to claim 4, wherein switching the charging current thresholdof the electronic device from the third charging current threshold tothe first charging current threshold and controlling charging of theelectronic device according to the first charging current thresholdcomprises: detecting temperature data of the electronic device;determining whether the temperature data is greater than a firsttemperature threshold; switching the charging current threshold of theelectronic device from the third charging current threshold to the firstcharging current threshold when the temperature data is greater than thefirst temperature threshold; and controlling charging of the electronicdevice according to the first charging current threshold.
 7. The methodaccording to claim 4, wherein switching the charging current thresholdof the electronic device from the third charging current threshold tothe first charging current threshold and controlling charging of theelectronic device according to the first charging current thresholdcomprises: determining a duration in which charging of the electronicdevice is controlled according to the third charging current threshold;switching the charging current threshold of the electronic device fromthe third charging current threshold to the first charging currentthreshold when the duration in which charging of the electronic deviceis controlled according to the third charging current threshold isgreater than a preset first time threshold; and controlling charging ofthe electronic device according to the first charging current threshold.8. The method according to claim 1, wherein the third charging currentthreshold is greater than the first charging current threshold, and thefirst charging current threshold is greater than the second chargingcurrent threshold.
 9. A fast charging apparatus for an electronicdevice, the apparatus comprising: a Universal Serial Bus (USB)interface; and a processor coupled to the USB interface and configuredto: perform a successful communication handshake with a USB host deviceusing the USB interface; measure, for a plurality of preset chargingcurrent thresholds, a charging data set of the electronic device underthe plurality of preset charging current thresholds, the plurality ofpreset charging current thresholds comprising a first charging currentthreshold and a second charging current threshold, the charging data setcomprising a corresponding first charging voltage value and acorresponding first charging current value of the electronic deviceunder the first charging current threshold, and a corresponding secondcharging voltage value and a corresponding second charging current valueof the electronic device under the second charging current threshold;calculate a maximum charging current value corresponding to theelectronic device according to the corresponding first charging voltagevalue, the corresponding first charging current value, the correspondingsecond charging voltage value, and the corresponding second chargingcurrent value, the maximum charging current value being different thanthe first charging current threshold and the second charging currentthreshold; and a charger coupled to the processor and configured to: setthe maximum charging current value as a third charging current thresholdof the electronic device; and control charging of the electronic deviceaccording to the third charging current threshold.
 10. The apparatusaccording to claim 9, wherein the processor is configured to measure thecharging data set by being configured to, for each preset chargingcurrent threshold of the plurality of preset charging currentthresholds: set a data collection point in a power management integratedcircuit of the electronic device; and acquire a corresponding chargingdata set of the electronic device under the preset charging currentthreshold from an analog to digital converter of the power managementintegrated circuit.
 11. The apparatus according to claim 9, wherein theprocessor is configured to calculate the maximum charging current valueby being configured to: calculate a supply voltage value of the USB hostdevice and an impedance value of a USB connection cable according to thecorresponding first charging voltage value, the corresponding firstcharging current value, the corresponding second charging voltage value,and the corresponding second charging current value; calculate acharging current consumption rate coefficient according to the supplyvoltage value of the USB host device, the impedance value of the USBconnection cable, the first charging current threshold, and the secondcharging current threshold; and calculate the maximum charging currentvalue according to the charging current consumption rate coefficient,the maximum charging current value corresponding to the electronicdevice when a minimum working voltage of the electronic device is met.12. The apparatus according to claim 9, wherein the processor is furtherconfigured to: switch a charging current threshold of the electronicdevice from the third charging current threshold to the first chargingcurrent threshold for a first time value; control charging of theelectronic device according to the first charging current threshold;switch the charging current threshold of the electronic device from thefirst charging current threshold to the third charging current thresholdafter charging of the electronic device is controlled according to thefirst charging current threshold for a second time value; and controlcharging of the electronic device according to the third chargingcurrent threshold.
 13. The apparatus according to claim 12, wherein theprocessor is further configured to: detect temperature data of theelectronic device; switch the charging current threshold of theelectronic device from the third charging current threshold to the firstcharging current threshold when the temperature data is greater than afirst temperature threshold; and control charging of the electronicdevice according to the first charging current threshold.
 14. Theapparatus according to claim 12, wherein the processor is furtherconfigured to: determine when a duration in which charging of theelectronic device is controlled according to the third charging currentthreshold is greater than a preset first time threshold; switch thecharging current threshold of the electronic device from the thirdcharging current threshold to the first charging current threshold; andcontrol charging of the electronic device according to the firstcharging current threshold.